package com.lcc.lynx.base.system.controller;

import com.lcc.lynx.common.ResultVO;
import com.lcc.lynx.jdbc.IByIdController;
import com.lcc.lynx.security.annotation.Permission;
import com.lcc.lynx.base.system.pojo.dv.SysRoleDV;
import com.lcc.lynx.base.system.service.SysRoleService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** 
 * 系统角色控制实现
 * @auth lcc
 * @date 2025-01-01
 */
@RestController
@AllArgsConstructor
@RequestMapping("/sys/role")
public class SysRoleController implements IByIdController<SysRoleDV> {

    private SysRoleService service;
    

    @Override
    public SysRoleService getService() {
       return service;
    }


    @RequestMapping("/addAndMenu")
    @Permission(Permission.add)
    public ResultVO addAndMenu(@RequestBody SysRoleDV dv){
        service.addAndMenu(dv);
        return ResultVO.success();
    }

    @RequestMapping("/updateAndMenu")
    @Permission(Permission.upd)
    public ResultVO updateAndMenu(@RequestBody SysRoleDV dv){
        service.updateAndMenu(dv);
        return ResultVO.success();
    }

    @RequestMapping("/updateMenu")
    @Permission(Permission.upd)
    public ResultVO updateMenu(@RequestBody SysRoleDV dv){
        service.updateMenu(dv);
        return ResultVO.success();
    }

}